#ifndef PARTICLE_MANAGER_H
#define PARTICLE_MANAGER_H

#include "MLObj.h"
#include "ParticleTrack.h"

#include <map>

class ParticleManager :public MLObj {
public:
	ParticleManager(
		int frame_size_x, int frame_size_y,
		double frame_rate,
		std::vector<VelocityStream>& streams,
		std::map<std::string, Color>& colors,
		double brightness,
		Byte alpha,
		Double2 lifespan_range,
		Location radius_range,
		Double2 v_range,
		Double2 a_delta_range,
		Double2 init_angle_range,
		Double2 a_angle_range,
		double blur_sigma,
		double particle_sparseness,
		int record_radius,
		double trailing_decay
	);
	void get_frame(size_t frame_index, MLFrame& frame);

private:
	std::vector<ParticleTrack> _tracks;
	GLuint _mix_glsl;
	GLuint _mix_with_alpha_glsl;
	GaussianBlurKernel _blur_kernel;
	MLFrame _trailing_frame;
	double _trailing_decay;
};
#endif
